package com.sixuerain.heartkey.prayer.db;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;

public class DBConnect {
	
	private DatabaseHelper dbHelper = null;
	public DBConnect(Context context) {
		dbHelper = DatabaseHelper.getInstance(context);
	}
	
	public SQLiteDatabase getWritableDB() {
		return dbHelper.getWritableDatabase();
	}
	
	public SQLiteDatabase getReadableDB(){
			return dbHelper.getReadableDatabase();
	}
	
	public SQLiteDatabase getWritableDB(Context context) {
		if(dbHelper==null)
			dbHelper = DatabaseHelper.getInstance(context);
		return dbHelper.getWritableDatabase();
	}
	
	public SQLiteDatabase getReadableDB(Context context){
		if(dbHelper==null)
			dbHelper = DatabaseHelper.getInstance(context);
		return dbHelper.getReadableDatabase();
	}


}
